<template>
	<view class="zh-webview">
		<web-view :webview-styles="webviewStyles" :src="pageUrl"></web-view>
	</view>
</template>

<script setup lang="ts">
	import { reactive, ref } from 'vue'
	import { onLoad } from '@dcloudio/uni-app';
	import { tip } from '@/utils'
	
	const webviewStyles = reactive({
		progress: {
			color: '#FF3333'
		}
	})
	const pageUrl = ref('')
	
	onLoad((options:any) => {
		tip.showLoading('加载中...')
		pageUrl.value = options.url
		const t = setTimeout(() => {
			tip.hideLoading()
			clearTimeout(t)
		}, 1000)
	})
</script>

<style lang="scss" scoped>

</style>
